package com.chookss.tools;

import com.chookss.home.entity.LogEntity;
import com.chookss.home.search.entity.SearchAllEntity;
import com.chookss.mine.entity.MyViedeoEntity;
import com.chookss.tiku.entity.MyExam;
import com.chookss.tiku.entity.Subject;
import com.chookss.video.entity.VideoEntity;

public class EntityUtils {
    public static VideoEntity modelA2B(MyViedeoEntity.VideoListBean item) {
        try {
            VideoEntity video = new VideoEntity();
            video.id = item.getId();
            video.companyCode = item.getCompanyCode();
            video.employeeCode = item.getEmployeeCode();
            video.employeeName = item.getEmployeeName();
            video.employeeId = item.getEmployeeId();
            video.headPhotoUrl = item.getHeadPhotoUrl();
            video.headPhotoThumbUrl = item.getHeadPhotoThumbUrl();
            video.videoTitle = item.getVideoTitle();
            video.videoId = item.getVideoId();
            video.videoCoverPath = item.getVideoCoverPath();
            video.videoCollectionsCode = item.getVideoCollectionsCode();
            video.videoCollectionsName = item.getVideoCollectionsName();
            video.videoLikeCounts = item.getVideoLikeCounts();
            video.videoShareCounts = item.getVideoShareCounts();
            video.videoCollectCounts = item.getVideoCollectCounts();
            video.videoCommentCounts = item.getVideoCommentCounts();
            video.catalogCodes = item.getCompanyCode();
            video.catalogNames = item.getCatalogNames();
            video.isLike = item.getIsLike();
            video.isCollect = item.getIsCollect();
            video.courseCode = item.getCourseCode();
            video.videoType = item.getCourseCode();
            video.youIsfans = item.getYouIsfans();
            video.isYoufans = item.getIsYoufans();
            video.videoType = item.getVideoType();
            video.videoPlayCounts = "0";
            return video;
        } catch (Exception e) {
            return null;
        }
    }
    public static MyExam modelA2B(SearchAllEntity.ExamBean.ListBean item) {
        try {
            MyExam myExam = new MyExam();
            myExam.examCode = item.getExamCode();
            myExam.examName = item.getExamName();
            myExam.examTimeLength = item.getExamTimeLength();
            myExam.examDetail = item.getExamDetail();
            myExam.startTime = item.getStartTime();
            myExam.endTime = item.getEndTime();
            myExam.score = item.getScore();
            myExam.seconds = item.getSeconds();
            myExam.examStatus = item.getExamStatus();
            myExam.recordUid = item.getRecordUid();
            myExam.createTime = item.getCreateTime();
            return myExam;
        } catch (Exception e) {
            return null;
        }
    }
    public static Subject modelA2B(SearchAllEntity.SubjectBean.ListBean item) {
        try {
            Subject subject = new Subject();
            subject.subjectCode = item.getSubjectCode();
            subject.subjectContent = item.getSubjectContent();
            subject.isContainPicture = item.getIsContainPicture();
            subject.pictureUrl = item.getPictureUrl();
            subject.subjectTypeName = item.getSubjectTypeName();
            subject.subjectTypeCode = item.getSubjectTypeCode();
            subject.hardLvl = item.getHardLvl();
            subject.answerDetail = item.getAnswerDetail();
            subject.catalogCode = item.getCatalogCode();
            subject.subjectScore = item.getSubjectScore();
            subject.collectFlag = item.getCollectFlag();
            subject.optionLvlNo = "";
            subject.isRight = "";
            subject.needStopTime = "";
            subject.answerId = "";

            return subject;
        } catch (Exception e) {
            return null;
        }
    }
    public static LogEntity modelA2B(SearchAllEntity.DiaryBean.ListBean item) {
        try {
            LogEntity logEntity = new LogEntity();
            logEntity.setId(item.getId());
            logEntity.setReportType(item.getReportType());
            logEntity.setReportCode(item.getReportCode());
            logEntity.setEmployeeCode(item.getEmployeeCode());
            logEntity.setEmployeeName(item.getEmployeeName());
            logEntity.setFinishWork(item.getFinishWork());
            logEntity.setUnFinishWork(item.getUnFinishWork());
            logEntity.setNextWorkPlan(item.getNextWorkPlan());
            logEntity.setNeedHelpWork(item.getNeedHelpWork());
            logEntity.setRemark(item.getRemark());
            logEntity.setPictureUrl(item.getPictureUrl());
            logEntity.setVideoId(item.getVideoId());
            logEntity.setPeriodName(item.getPeriodName());
            logEntity.setCreateTime(item.getCreateTime());
            logEntity.setTitle(item.getTitle());
            logEntity.setContent(item.getContent());
            logEntity.setPost(item.getPostName());
            logEntity.setHeadPhotoThumbUrl(item.getHeadPhotoUrl());
            logEntity.setHeadPhotoUrl(item.getHead_photo_thumb_url());
            logEntity.setPictureList(item.getPictureList());
            return logEntity;
        } catch (Exception e) {
            return null;
        }
    }
}
